import fetch from '@/utils/request'

export function addPost(data) {
  return fetch({
    url: '/posts',
    method: 'post',
    data
  })
}

export function updatePost(id, data) {
  return fetch({
    url: '/posts/' + id,
    method: 'put',
    data
  })
}

